home *** CD-ROM | disk | FTP | other *** search
- package sub_arctic.test;
-
-
- import sub_arctic.lib.*;
- import sub_arctic.output.*;
- import sub_arctic.input.*;
- import sub_arctic.constraints.std_function;
-
- import java.applet.Applet;
-
- public class point_test extends debug_interactor_applet {
- public void build_ui(base_parent_interactor top) {
- display_help_container dhc1,dhc2,dhc3;
-
- /* create a button centered in the top level interactor */
- button pointee =
- new status_button("Point At Me", null,
- "This is a demo of the pointable input protocol",
- this);
- pointee.set_x_constraint(std_function.centered(PARENT.W(), 0));
- pointee.set_y_constraint(std_function.far_edge_just(NEXT_SIBLING.Y(), 0));
- /* make the button a child of the top level */
- top.add_child(pointee);
- /*
- * make first display help container
- */
- dhc1=new display_help_container(new button("I have help",null),
- "This is some help text");
-
- dhc1.set_x_constraint(std_function.centered(PARENT.W(), 0));
- dhc1.set_y_constraint(std_function.centered(PARENT.H(), 0));
- top.add_child(dhc1);
- /*
- * make second display help container
- */
- dhc2=new display_help_container(new button("I have help also",null),
- "This is yet more help text");
-
- dhc2.set_x_constraint(std_function.centered(PARENT.W(), 0));
- dhc2.set_y_constraint(std_function.offset(PREV_SIBLING.Y2(), 0));
- top.add_child(dhc2);
- /**
- * make another help container on the far right
- */
- dhc3=new display_help_container(new button("Helpable Button",null),
- "This is a really long piece of " +
- "help text to make sure we can see it");
- dhc3.set_x_constraint(std_function.far_edge_just(PARENT.W(), 0));
- dhc3.set_y_constraint(std_function.centered(PARENT.H(), 0));
- top.add_child(dhc3);
- }
- }
-
- class status_button extends button implements pointable {
- String st;
- Applet applet;
- public status_button(String label_text, callback_object co,
- String status_text, Applet app) {
- super(label_text,co);
- applet=app;
- st=status_text;
- }
- /**
- * Handle the mouse coming in
- */
- public boolean mouse_enter(event evt, Object user_info) {
- applet.showStatus(st);
- return true;
- }
- public void mouse_exit(event evt) {
- applet.showStatus("");
- }
-
- }
- /*=========================== COPYRIGHT NOTICE ===========================
-
- This file is part of the subArctic user interface toolkit.
-
- Copyright (c) 1996 Scott Hudson and Ian Smith
- All rights reserved.
-
- The subArctic system is freely available for most uses under the terms
- and conditions described in
- http://www.cc.gatech.edu/gvu/ui/sub_arctic/sub_arctic/doc/usage.html
- and appearing in full in the lib/interactor.java source file.
-
- The current release and additional information about this software can be
- found starting at: http://www.cc.gatech.edu/gvu/ui/sub_arctic/
-
- ========================================================================*/
-